-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-47709: [C++][FlightRPC] Return ODBC and data source information #47762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
| // Driver Information | ||
|
|
||
| TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoActiveEnvironments) { | ||
| this->Connect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the connect/disconnect be put in a SetUp/TearDown?
Also it might not be wise to add the tests directly to FlightSQLODBCTestBase; could we create a fixture for this test suite specifically (by subclassing)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, added separate test fixture ConnectionInfoTest
| TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoDriverName) { | ||
| this->Connect(); | ||
|
|
||
| Validate(this->conn, SQL_DRIVER_NAME, (SQLWCHAR*)L"Arrow Flight ODBC Driver"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use static_cast?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, fixed
e6f61c6 to
49745a6
Compare
alinaliBQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worked on code review comments
| // Driver Information | ||
|
|
||
| TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoActiveEnvironments) { | ||
| this->Connect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, added separate test fixture ConnectionInfoTest
| TYPED_TEST(FlightSQLODBCTestBase, TestSQLGetInfoDriverName) { | ||
| this->Connect(); | ||
|
|
||
| Validate(this->conn, SQL_DRIVER_NAME, (SQLWCHAR*)L"Arrow Flight ODBC Driver"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, fixed
lidavidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase!
5452bfd to
f7a7386
Compare
| void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type, | ||
| SQLULEN compared_value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do have the same general comment: I think you would be better off creating utility getters (that throw if they fail) and then using standard GTest assertions, instead of making a function for every combination of data type and comparator. (Also, can they be shared across test files?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea when I saw your comment on the SQLStmtAttr PR, I thought of this PR as well since it also has the GreaterThan functions. I was waiting to see if the changes we made for SQLStmtAttr PR #47773 are what you are looking for. This is something we will be working on for sure.
On the other note, I am not sure if sharing certain utility getter across test files would be useful, since for example SQLGetInfo will only be called in connection_info_test.cc and no other test files. We won't be having copies of utility getters in different test files. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, if this is the same test file then never mind that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lidavidm I have fixed and added the utility getters, please have another look, thanks!
f7a7386 to
f4aec24
Compare
alinaliBQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed code review comments
| void ValidateGreaterThan(SQLHDBC connection, SQLUSMALLINT info_type, | ||
| SQLULEN compared_value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lidavidm I have fixed and added the utility getters, please have another look, thanks!
605971d to
fc711ae
Compare
Co-Authored-By: rscales <[email protected]> Create connection_info_test.cc Add SQLGetInfo tests Co-authored-by: justing-bq <[email protected]> Co-Authored-By: rscales <[email protected]> Address code review comments Co-authored-by: justing-bq <[email protected]> Work on code review comments Fix build issues with tests Use Utility getters for SQLGetInfo Remove `using List` * fix build issues Add truncation test
fc711ae to
c701849
Compare
|
Rebased and tested PR changes on local MSVC. PR is ready to be merged |
Rationale for this change
ODBC needs to give BI tools information about the driver itself and the data source it is connected to.
What changes are included in this PR?
SQLGetinfoto return driver and data source informationget_info_cache.ccAre these changes tested?
Tested on local MSVC Windows
Are there any user-facing changes?
No